package _15_Constructors;

import java.util.Scanner;

class Person2 
{
	static String courseName = "JAVA EE";
	public String name;
	String address;
	private final String egn = "";
	private int age;
	private String password;
	private String oldPass;
	private String newPass;
	
	City c = new City();
	
	Person2()
	{
		name = "Ivan";
		age = 8;
	}
	
	public Person2(String name)
	{
		this();
		this.name = name;
	}
	
	void changeCity(City newCity)
	{
		
	}
	
	public void changePassword(String oldPass, String newPass, Scanner scan)
	{
		System.out.println("Enter your old password: ");
		oldPass = scan.nextLine();
		System.out.println("Now enter your new password: ");
		newPass = scan.nextLine();
		if(newPass.equals(oldPass))
		{
			System.out.println("Your new password should differ from the old one.");
		}

	}
	
	int getAge(String password)
	{
		if(this.password.equals(password) )
		return age;
		else
			return -1;
	}
	
}
